/*
 *      Created on: Feb 24, 2011
 *      Author: topcoder
 */

#ifndef UNIT_H_
#define UNIT_H_

#include <string>
using namespace std;

const unsigned int    LENGTH = 0;
const unsigned int    VOLUME = 1;
const unsigned int    INVALIDTYPE = 2;

const unsigned int INVALID_QUANTITY = 0;

class Unit
{
    public:
        Unit(unsigned int ratio, UnitType type, string name);
        ~Unit();

        static ostream print(unsigned long quantity, UnitType type);

    private:
        string       getName()const;
        static Unit* unitList_m[INVALIDTYPE];
        unsigned int ratio_m;
        UnitType     type_m;
        string       name_m;
        Unit*        nextUnit_m;
};

#endif
